﻿#include "config.h"

int   VideoThread_exit=0;
enum AVPixelFormat HS_Video_HWPix_fmt;
void sleep_ms(unsigned long ms)
{
    QWaitCondition *wait = new QWaitCondition;
    QMutex xx;
    xx.unlock();
    wait->wait(&xx,ms);
    xx.unlock();
    delete wait;
}
enum AVPixelFormat get_hw_format(AVCodecContext *ctx,const enum AVPixelFormat *pix_fmts)
{
    const enum AVPixelFormat *p;
    for (p = pix_fmts; *p != -1; p++) {
        if (*p == HS_Video_HWPix_fmt)
            return *p;
    }
    PRTLOG()<<"Failed to get HW surface format.";
    return AV_PIX_FMT_NONE;
}
